package cn.wolfcode.wolf2w.test;


import lombok.Getter;
import lombok.Setter;

/**
 *
 * 枚举类的特点:
 *  1: 构造器是私有
 *  2: 枚举类型一旦定义完成, 实例对象个数是固定
 *  3: 剩下操作跟普通类一样
 */
@Getter
public enum MyDate {
    //调用2个参数构造器创建对象
    DATE1("date1", 1L),
    DATE2("date2", 2L);

    private String prefix;
    private Long time;
    //构造器
    private MyDate(String prefix, Long time){
        this.prefix = prefix;
        this.time = time;
    }

    public String join(String value){
        System.out.println(value);
        return value;
    }

}
